<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />

<script src="http://cdn.robotwebtools.org/EaselJS/current/easeljs.min.js"></script>
<script src="http://cdn.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>
<script src="http://cdn.robotwebtools.org/roslibjs/current/roslib.js"></script>
<script src="http://cdn.robotwebtools.org/ros2djs/current/ros2d.js"></script>
<script src="../build/nav2d.js"></script>

<script>
  /**
   * Setup all visualization elements when the page is loaded. 
   */
  function init() {
    // Connect to ROS.
    var ros = new ROSLIB.Ros({
      url : 'ws://localhost:9090'
    });

    // Create the main viewer.
    var viewer = new ROS2D.Viewer({
      divID : 'nav',
      width : 600,
      height : 480
    });

    // Setup the nav client.
    var nav = NAV2D.ImageMapClientNav({
      ros : ros,
      rootObject : viewer.scene,
      viewer : viewer,
      serverName : '/move_base',
      image : 'map.png'
    });
  }
</script>
</head>

<body onload="init()">
  <h1>Simple Map Image Example</h1>
  <div id="nav"></div>
</body>
</html>